package init

import (
	"github.com/spf13/viper"
)

type Conf struct {
	Mysql struct {
		User     string
		Password string
		Host     string
		Port     string
		Database string
	}
}

var Config Conf

func ConfigInit() {
	viper.SetConfigFile("../../dev.yaml")

	err := viper.ReadInConfig()
	if err != nil {
		panic("读取失败")
	}
	err = viper.Unmarshal(&Config)
}
